const dbutile = {
    init(config) {
        sequelize = new Sequelize('', config.username, config.password, {
            host: config.address,
            dialect: config.sqltype,
            port: config.port, //-------------> change port here
            // driver: 'tedious',
            // dialectOptions: {
            //     instanceName: MSSQLSERVER
            // },
            define: {
                timestamps: false
            },
            pool: {
                max: 5,
                min: 0,
                idle: 10000
            },
        })
        // 测试连接
        sequelize.authenticate().then(() => {
            console.log('auth ok数据库连接成功')
            // alert("数据库连接成功！");
        }).catch(() => {
            console.log('auth err数据库连接失败！')
            // alert("数据库连接失败！");
        })
    },
}
export default dbutile;
